; (function () {
    //return
    let arr = [1, 11, 32, 24, 56, 22, 5, 2, 5]

    arr.sort()
    console.log(arr);// [1, 11, 2, 22, 24, 32, 5, 5, 56]
    // =================================
    // 当这个排序本身有一定的不稳定性.
})();
; (function () {
    //return
    let arr = [1, 11, 32, 24, 56, 22, 5, 2, 5]

    arr.sort((a, b) => a - b) // 升序
    console.log(arr);//[1, 2, 5, 5, 11, 22, 24, 32, 56]

    arr.sort((a, b) => b - a) // 降序
    console.log(arr);//[56, 32, 24, 22, 11, 5, 5, 2, 1]

})();